package cn.bdqn.util;

import redis.clients.jedis.Jedis;

/**
 * Created by Administrator on 2018/8/17.
 */
public class RedisUtil {
    public static void main(String[] args) throws InterruptedException {
        Jedis jedis = new Jedis("127.0.0.1");
        //对象.方法（参数）
        jedis.set("username","你好啊");
        jedis.append("username", "admin");
        jedis.expire("username",6);
        Thread.sleep(7000);
        String username = jedis.get("username");
        String password = jedis.get("password");
        System.out.println(username);
        System.out.println(password);
        jedis.close();
    }
}
